package com.cc.visitor.controller;

import com.cc.alltype.ResponseResult;
import com.cc.visitor.utils.HomeServeUtils;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author chanchaw
 * @create 2025-05-16 9:01
 */
@CrossOrigin
@RestController
@RequestMapping("/homeserve")
public class HomeServeController {
    @Autowired
    private HomeServeUtils homeServeUtils;
    @PostMapping("/timeControl")
    public ResponseResult timeControl(@RequestBody Map<String,Boolean> params) throws JsonProcessingException {
        Boolean b = params.get("open");
        return homeServeUtils.openInternet(b);
    }
}
